<?php
    include 'base.php';

    // 定义自字段
    $pagenum = $_GET['pagenum'];
    $pagesize = $_GET['pagesize'];

    // 参数1: 从哪一条开始
    // 参数2：拿多少条
    $start = ($pagenum - 1) * $pagesize;

    $sql = "SELECT * FROM `dawanqu` LIMIT $start,$pagesize";

    $res = $conn->query($sql);

    $arr = array();

    while ($row = mysqli_fetch_assoc($res)) {
        array_push($arr, $row);
    }

    echo json_encode($arr);
?>